#ifndef RTPPARSE_RTP_LISTENER_H
#define RTPPARSE_RTP_LISTENER_H

#include "rtp/Producer.h"
#include "rtp/RtpPacket.h"
#include <unordered_map>
#include <string>

class RtpListener {
public:
    void AddProducer(Rtp::Producer *producer);
    void RemoveProducer(Rtp::Producer *producer);

    Rtp::Producer* GetProducer(const Rtp::RtpPacket *packet);
    Rtp::Producer* GetProducer(uint32_t ssrc) const;

public:
    std::unordered_map<uint32_t, Rtp::Producer *> ssrcTable;
    std::unordered_map<std::string, Rtp::Producer *> midTable;
    std::unordered_map<std::string, Rtp::Producer *> ridTable;
};

#endif